//用户账号接口模块
//引入工具函数
import request from '@/until/request'
//登录接口函数
export const checkLoginReq = data => {
    //返回axios接口调用结果
    return request({
        method: 'post',
        url: '/users/checkLogin',
        data,
    })
}

//检查账号是否重复
export const checkRepeatReq = data => {
    return request({
        method: 'post',
        url: '/users/repeat',
        data,
    })
}

//添加账号
export const addUserReq = data => {
    return request({
        method: 'post',
        url: '/users/add',
        data,
    })
}

//获取账号列表
export const getUsersListReq = params => {
    return request({
        method: 'get',
        url: '/users/list',
        params,
    })
}

//删除账号
export const delUsersReq = params => {
    return request({
        method: 'get',
        url: '/users/del',
        params,
    })
}

//修改账号
export const editUserReq = data => {
    return request({
        method: 'post',
        url: '/users/edit',
        data,
    })
}

//批量删除账号
export const batchdelUserReq = data => {
    return request({
        method: 'post',
        url: '/users/batchdel',
        data,
    })
}

//获取个人信息
export const getUserInfoReq = () => {
    return request({
        method: 'get',
        url: '/users/info',
    })
}

//头像上传接口
export const avatarUploadReq = data => {
    return request({
        method: 'post',
        url: '/users/avatar_upload',
        data,
    })
}

//修改用户头像
export const avatarReditReq = params => {
    return request({
        method: 'get',
        url: '/users/avataredit',
        params,
    })
}

//修改密码
export const editPWDReq = data => {
    return request({
        method: 'post',
        url: '/users/editpwd',
        data,
    })
}